package com.xumingxun.aibox.domain.dto;

import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class Result<T> {
    Integer code=200;
    String message="成功";
    T data;
    public static <T> Result<T> success(T data) {
        return new Result<T>().setCode(200).setMessage("成功").setData(data);
    }
    public static <T> Result<T> success() {
        return new Result<T>().setCode(200).setMessage("成功");
    }
    public static <T> Result<T> fail(String message) {
        return new Result<T>().setCode(500).setMessage(message);
    }

}
